package com.duan.blog.service;

import com.duan.blog.dao.UserMapper;
import com.duan.blog.model.User;
import com.duan.blog.model.vo.NamePasswordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public User selectUserById(int userId) {
        return userMapper.selectUserById(userId);
    }
    public List<User> selectAllUser(){
        return userMapper.selectAllUser();
    }
    public NamePasswordVo selectNameAndPasswordByName(String name){
        return userMapper.selectNameAndPasswordByName(name);
    }

    public String addUser(User user){
        return userMapper.addUser(user);
    }
    public String addAllUser(List<User> users){
        return userMapper.addAllUser(users);
    }

    public String delUserById(int userId){
        return userMapper.delUserById(userId);
    }
    public String updateUser(User user){
        return userMapper.updateUser(user);
    }
}
